import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Test {
    public static void main(String[] args) {
        String s = "1111dddd";
        Pattern p = Pattern.compile("([0-9]+)([a-zA-Z]+)");
        Matcher m = p.matcher(s);
        if (m.matches()) { // 整串匹配
            System.out.println("数字: " + m.group(1)); // 1111
            System.out.println("字母: " + m.group(2)); // dddd
        }
    }

}
